package com.itheima.common;


/*
基于Threadlocal封装工具类，用户保存和获取当前登录用户的id
 */
public class BaseContext {

    private static ThreadLocal<Long> tl=new ThreadLocal<>();

    //设置值
    public static void setThreadLocal(Long id){
        tl.set(id);
    }

    //获取值
    public static Long getThreadLocal(){
        return tl.get();
    }

}
